package com.newtouch.bxzs.enterprise.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.newtouch.bxzs.common.base.model.AcceptionCustomerRecord;
import com.newtouch.bxzs.enterprise.model.bo.AcceptionCustomerRecordBO;
import com.newtouch.bxzs.enterprise.model.vo.CustomerCndVO;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

/**
 * 客户接收Mapper
 * <p>
 * <b>History:</b>
 * <table border="1">
 * <tr>
 * <th>Date</th>
 * <th>Operator</th>
 * <th>Memo</th>
 * </tr>
 * <tr>
 * <td>2021/1/12 14:07</td>
 * <td>Amour</td>
 * <td>Create</td>
 * </tr>
 * </table>
 *
 * @author Amour
 * @version 1.0.0
 * @since 1.0.0
 */
@Mapper
public interface AcceptionCustomerRecordMapper extends BaseMapper<AcceptionCustomerRecord> {


    /**
     * 添加客户接收记录消息
     * @param acceptionCustomerRecord 客户接收实体
     * @return 修改条数
     */
    int saveAcceptionCustomerRecord(@Param("customerRecord") AcceptionCustomerRecord acceptionCustomerRecord);


    /**
     * 客户接收列表
     * @param page 分页
     * @param customerCnd 查询条件
     * @param pushCustomerStatus 状态
     * @return AcceptionCustomerRecordBO
     */
    Page<AcceptionCustomerRecordBO> getReceiveList(Page<AcceptionCustomerRecordBO> page,
                                                   @Param("customer")CustomerCndVO customerCnd,
                                                   @Param("pushCustomerStatus")String pushCustomerStatus,
                                                   @Param("pushStatus")String pushStatus);


    /***
     * 保单服务意向接收列表
     * @param page 分页
     * @param customerCnd 查询条件
     * @param pushCustomerStatus 状态
     * @return AcceptionCustomerRecordBO
     */
    Page<AcceptionCustomerRecordBO> getAcceptPolicy(Page<AcceptionCustomerRecordBO> page,
                                                    @Param("customer")CustomerCndVO customerCnd,
                                                    @Param("pushCustomerStatus")String pushCustomerStatus);


    /**
     * 根据客户接收记录id获取合作公司统一社会信用代码
     * @param accetptionCustomerRecordId 客户接收记录编号
     * @return 合作公司编号
     */
    String getCooperationCompanyId(String accetptionCustomerRecordId);

    /**
     * 获取用户id
     * @param userJobNumber 用户工号
     * @return 用户id
     */
    String getUserId(String userJobNumber);

    /**
     * 接收客户退回
     * @param pushCustomerRecordId 客户退回
     * @return 成功标识
     */
    int customerGoBack(@Param("pushCustomerRecordId") String pushCustomerRecordId);

    /**
     * 接收客户退回
     * @param accetptionCustomerRecordId 客户退回
     * @return 成功标识
     */
    int goBackCustomer(String accetptionCustomerRecordId);
}
